$(function () {
    initChartMigrateProvince();
    initChartMigrateChina();
    initChartMigrateWorld();
});

// 省内迁徙图
function initChartMigrateProvince() {
    var data = [
        {name: '咸阳', value: 95},
        {name: '宝鸡', value: 90},
        {name: '铜川', value: 80},
        {name: '渭南', value: 70},
        {name: '汉中', value: 60},
        {name: '安康', value: 50},
        {name: '商洛', value: 40},
        {name: '延安', value: 30},
        {name: '榆林', value: 20}
    ];
    var areaName = "西安";

    EchartsUtil.migrateProvince("migrateProvinceIn", data, areaName, "in");
    EchartsUtil.migrateProvince("migrateProvinceOut", data, areaName, "out");
}

// 国内迁徙图
function initChartMigrateChina() {
    var data = [
        {name: '上海', value: 95},
        {name: '广州', value: 90},
        {name: '大连', value: 80},
        {name: '南宁', value: 70},
        {name: '南昌', value: 60},
        {name: '拉萨', value: 50},
        {name: '长春', value: 40},
        {name: '包头', value: 30},
        {name: '重庆', value: 20},
        {name: '常州', value: 10}
    ];
    var areaName = "西安";

    EchartsUtil.migrateChina("migrateChinaIn", data, areaName, "in");
    EchartsUtil.migrateChina("migrateChinaOut", data, areaName, "out");
}

// 国际迁徙图
function initChartMigrateWorld() {
    var data = [
        {"name": "澳大利亚", "value": "4037"},
        {"name": "俄罗斯", "value": "2859"},
        {"name": "南非", "value": "1020"},
        {"name": "美国", "value": "781"},
        {"name": "法国", "value": "560"},
        {"name": "加拿大", "value": "462"}
    ];
    var areaName = "西安";

    EchartsUtil.migrateWorld("migrateWorldIn", data, areaName, "in");
    EchartsUtil.migrateWorld("migrateWorldOut", data, areaName, "out");
}